﻿/*
	Class			------
	
	Description		------
					
	History			1.00	-/--/--		Created
	
	To Do			------
*/

package tv.digitalfx
{
	import pete.layout.Align;
	import pete.tools.ColorUtil;
	import tv.digitalfx.Clump;
	import tv.digitalfx.PixelBox;
	import flash.display.Sprite;
	
	public class NeonBox extends Sprite
	{
		
		public function NeonBox ($width:Number = 100, $height = 100, $strokeColor:uint = 0xffffff, $fillColor:uint = 0x111111, $type:String = "rectangle")
		{
			var fill:Clump				= new Clump ($width, $height, $fillColor);
			
			var strokeWidth:Number;
			var strokeHeight:Number;
			
			if ($type == PixelBox.RECTANGLE)
			{
				strokeWidth 		= $width - ($width * Clump.EDGE_X * 2);
				strokeHeight		= $height - ($height * Clump.EDGE_Y * 2);
			}
			else if ($type == PixelBox.VERTICAL)
			{
				strokeWidth 		= $width - ($width * Clump.EDGE_X * 2);
				strokeHeight		= $height;
			}
			else if ($type == PixelBox.HORIZONTAL)
			{
				strokeWidth 		= $width;
				strokeHeight		= $height - ($height * Clump.EDGE_Y * 2);
			}
			
			var strokeARGB:uint			= ColorUtil.toARGB ($strokeColor);
			var stroke:PixelBox			= new PixelBox (strokeWidth, strokeHeight, strokeARGB, $type);
			
			Align.centerTo				(stroke, fill);
			addChild					(fill);
			addChild					(stroke);
			
		}
		
	}
}